package com.itheima.day06;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;

public class Demo02 {
    public static void main(String[] args) {

        HashSet<String> set = new HashSet<>();
        set.add("大咪咪");
        set.add("露西法");
        set.add("露西亚");
        set.add("露西");
        set.add("露丝");

        System.out.println("集合大小："+set.size());

        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println("迭代器遍历："+iterator.next());

        }

        for (String s : set) {
            System.out.println("增强for："+s);
        }

    }
}
